package com.gc.baselib.utils;


import android.graphics.drawable.Drawable;

import com.gc.baselib.base.BaseApplication;


public class ResourceUtils {
    public static String getString(int resId){
        return BaseApplication.getInstance().getString(resId);
    }
    public static int getResId(String name,String resType){
       return BaseApplication.getInstance().getResources().getIdentifier(name,resType,BaseApplication.getInstance().getPackageName());
    }

    public static int getDimensId(String name){
        return getResId(name,"dimen");
    }
    public static int getStringId(String name){
        return getResId(name,"string");
    }
    public static int getDrawableId(String name){
        return getResId(name,"drawable");
    }
    public static int getLayoutId(String name){
        return getResId(name,"layout");
    }


    public static Drawable getDrawable(int resId) {
        return BaseApplication.getInstance().getDrawable(resId);
    }
    public static int getColor(int resId) {
        return BaseApplication.getInstance().getResources().getColor(resId);
    }
}
